﻿@using BonjourQuotation.UI.Models.OptionalModel
@model OptionalDetailsViewModel
@{
    
}
@using (@Html.BeginForm("SaveOptionalDetailData", "Optional", FormMethod.Post, new { id = "LoadOptionalDetailsForm" }))
{
   <div id="ErrorMessagesDivPopUp">
        <label for="Validation" id="errorMessageClient" class="errorMessage"></label>
        @if (Model.Message != null)
        {
            @Html.LabelForModel(Model.Message, new { @class = "errorMessage", id = "errorMessageServer" })
        }
    </div>
    
    @Html.HiddenFor(model => model.OptionalID)
<div class="pull-right"  style="margin-bottom:15px;">
    <div class="row form-row">
        <div class="ElementsPaddingRight30 col-lg-7">
            <div class="input-group">
                <span class="input-group-addon inpputgrtext table_inputs_SmallPadding2 inpputgrback">@Html.LabelFor(model => model.OptionalSelectedVendorName)</span>
                @Html.TextBoxFor(model => model.OptionalSelectedVendorName, new { @class = "OptionalDetailsElementChange table_inputs_SmallPadding2 inpputgr form-control ElementsForValidation Required QuotaTxtComplete" })
                @Html.HiddenFor(model => model.OptionalSelectedVendorID)
            </div>
        </div>
        <div class="ElementsPaddingRight30 col-lg-5">
            <div class="input-group">
                <span class="input-group-addon inpputgrtext table_inputs_SmallPadding2 inpputgrback">@Html.LabelFor(model => model.ContractSignDate)</span>
                @Html.TextBoxFor(model => model.ContractSignDate, new { @class = "OptionalDetailsElementChange table_inputs_SmallPadding2 inpputgr form-control ElementsForValidation Date OptionalDeteilsDataCalendar" })
            </div>
        </div>
    </div>

    <div class="row form-row">
        <div class="ElementsPaddingRight30 col-lg-5">
            <div class="input-group">
                <span class="input-group-addon inpputgrtext table_inputs_SmallPadding2 inpputgrback">@Html.LabelFor(model => model.ContractStartDate)</span>
                @Html.TextBoxFor(model => model.ContractStartDate, new { @class = "OptionalDetailsElementChange table_inputs_SmallPadding2 inpputgr form-control ElementsForValidation Date Required OptionalDeteilsDataCalendarFromDiv" })
            </div>
        </div>
        <div class="ElementsPaddingRight30 col-lg-5">
            <div class="input-group">
                <span class="input-group-addon inpputgrtext table_inputs_SmallPadding2 inpputgrback">@Html.LabelFor(model => model.ContractEndDate)</span>
                @Html.TextBoxFor(model => model.ContractEndDate, new { @class = "OptionalDetailsElementChange table_inputs_SmallPadding2 inpputgr form-control ElementsForValidation Date Required OptionalDeteilsDataCalendarToDiv" })
            </div>
        </div>
        <div class="ElementsPaddingRight30 col-lg-2">
            <div class="input-group">
                <span class="input-group-addon inpputgrtext table_inputs_SmallPadding2 inpputgrback">@Html.LabelFor(model => model.Active)</span>
                @Html.CheckBoxFor(model => model.Active, new { @class = "OptionalDetailsElementChange" })
            </div>
        </div>
    </div>
    <div class="row form-row">
        <div class="ElementsPaddingRight30 col-lg-12">
            <div class="input-group">
                <span class="input-group-addon inpputgrtext table_inputs_SmallPadding2 inpputgrback">@Html.LabelFor(model => model.Description)</span>
                @Html.TextAreaFor(model => model.Description, new { @class = "OptionalDetailsElementChange table_inputs_SmallPadding2 inpputgr form-control ElementsForValidation MaxLength250" })
            </div>
        </div>
    </div>
        @if (Model.OptionalID == 0)
        {
            <div class="SaveCancelDiv">
                <button class="btn14 btn50" type="button" onclick="$('#cboxClose').click()">Cancel</button>
                @if (Model.MenuManageOptionalEdit)
                {
                    <button class="btn14 btn50" type="button" id="OptionalDetailsSaveBtn">Save</button>
                }
                else
                {
                    <button class="btn14 btn50 disabled" type="button" disabled="disabled" id="OptionalDetailsSaveBtn">Save</button>
                }
            </div>
        }
        else
        {
            <div style="width: 541px; min-height: 260px; max-height: 320px; margin: auto; padding-top: 50px; float: left; padding-bottom: 30px; margin-left: 9px; ">
                <table class="table table-bordered table-hover table-condensed" style="margin-bottom: -1px !important; width: 520px;background-color:white;">
                    <thead>
                        <tr>
                            <th width="20%;" class="GridHeaders font12">Pax From</th>
                            <th width="20%;" class="GridHeaders font12">Pax To</th>
                            <th width="20%;" class="GridHeaders font12">Currency</th>
                            <th width="20%;" class="GridHeaders font12">Price</th>
                            <th width="10%;" class="GridHeaders font12">Bus</th>
                            <th width="10%;" class="GridHeaders font12">Guide</th>
                        </tr>
                    </thead>
                </table>
             <div style="height: 240px; overflow-y: auto;">
                <table class="table table-bordered table-hover table-condensed" style="width: 520px; table-layout: fixed; background-color: white;">
                    <tbody>
                        @for (int ind = 0; ind < Model.Rows.Count; ind++)
                        {
                            @Html.HiddenFor(model => Model.Rows[ind].OptionalDetailID)
                            Model.SelectedCurrency = Model.Rows[ind].SelectedCurrency;
                            if (Model.MenuManageOptionalEdit)
                            {
                                <tr>
                                    <td width="20%;">@Html.TextBoxFor(model => model.Rows[ind].PaxFrom, new { @class = "OptionalDetailsElementChange table_inputs_100 table_inputs_WithoutBox ElementsForValidation QuotaOnlyDigits Required PaxFrom" })</td>
                                    <td width="20%;">@Html.TextBoxFor(model => model.Rows[ind].PaxTo, new { @class = "OptionalDetailsElementChange table_inputs_100 table_inputs_WithoutBox ElementsForValidation QuotaOnlyDigits Required PaxTo" })</td>
                                    <td width="20%;">
                                        @Html.DropDownListFor(model => Model.SelectedCurrency, new SelectList(Model.Currency, "Value", "Text"), new { @class = "OptionalDetailsElementChange table_inputs_100 table_inputs_WithoutBox CurrencyDrop" })
                                        @Html.DropDownListFor(model => Model.Rows[ind].SelectedCurrency, new SelectList(Model.Currency, "Value", "Text"), new { @class = "RoomGridDropHide" })
                                    </td>
                                    <td width="20%;">@Html.TextBoxFor(model => model.Rows[ind].Price, new { @class = "OptionalDetailsElementChange table_inputs_100 table_inputs_WithoutBox QuotaOnlyDecimalDigits" })</td>
                                    <td width="10%;" style="text-align:center">@Html.CheckBoxFor(model => model.Rows[ind].BusIncluded, new { @class = "OptionalDetailsElementChange" })</td>
                                    <td width="10%;" style="text-align:center">@Html.CheckBoxFor(model => model.Rows[ind].GuideIncluded, new { @class = "OptionalDetailsElementChange" })</td>
                                </tr>
                             }
                             else
                             {
                                <tr>
                                    <td width="20%;">@Html.TextBoxFor(model => model.Rows[ind].PaxFrom, new { @class = "OptionalDetailsElementChange table_inputs_100 table_inputs_WithoutBox ElementsForValidation QuotaOnlyDigits Required", @readonly = true })</td>
                                    <td width="20%;">@Html.TextBoxFor(model => model.Rows[ind].PaxTo, new { @class = "OptionalDetailsElementChange table_inputs_100 table_inputs_WithoutBox ElementsForValidation QuotaOnlyDigits Required", @readonly = true })</td>
                                    <td width="20%;">
                                        @Html.DropDownListFor(model => Model.SelectedCurrency, new SelectList(Model.Currency, "Value", "Text"), new { @class = "OptionalDetailsElementChange table_inputs_100 table_inputs_WithoutBox CurrencyDrop", @disabled = true })
                                        @Html.DropDownListFor(model => Model.Rows[ind].SelectedCurrency, new SelectList(Model.Currency, "Value", "Text"), new { @class = "RoomGridDropHide" })
                                    </td>
                                    <td width="20%;">@Html.TextBoxFor(model => model.Rows[ind].Price, new { @class = "OptionalDetailsElementChange table_inputs_100 table_inputs_WithoutBox QuotaOnlyDecimalDigits", @readonly = true })</td>
                                    <td width="10%;">@Html.LabelForModel(Model.Rows[ind].BusIncluded ? "Yes" : "No", new { @class = "table_inputs_65", @style = "text-align: left" })</td>
                                    <td width="10%;">@Html.LabelForModel(Model.Rows[ind].GuideIncluded ? "Yes" : "No", new { @class = "table_inputs_65", @style = "text-align: left" })</td>
                                </tr>
                            }
                        }
                    </tbody>
                </table>
            </div>
        </div>
        <div style="width: 741px; height: 110px; margin-left: 9px; float: left; padding-top: 10px" id="OptionalSaveCloseAddNewOptionalDetailBtns">
            @if (Model.MenuManageOptionalEdit)
            {
                <button class="btn14 btn50" style="float: right; margin-right: 15px; " type="button" id="OptionalDetailsSaveBtn">Save</button>
                <button class="btn14 btn50" style="float: right; margin-right: 15px; " type="button" onclick="$('#cboxClose').click()">Cancel</button>
                <button class="btn14 btn130" style="float: right; margin-right: 15px; " type="button" onclick="AddNewOptionalDetailsShow()">Add New Details</button>
            }
            else
            {
                <button class="btn14 btn50 disabled" style="float: right; margin-right: 15px; " type="button" disabled="disabled" id="OptionalDetailsSaveBtn">Save</button>
                <button class="btn14 btn50" style="float: right; margin-right: 15px; " type="button" onclick="$('#cboxClose').click()">Cancel</button>
                <button class="btn14 btn130 disabled" style="float: right; margin-right: 15px; " type="button" disabled="disabled" onclick="AddNewOptionalDetailsShow()">Add New Details</button>
            }
        </div>
    }
    </div>
}
@using (@Html.BeginForm("SaveOptionalDetailData", "Optional", FormMethod.Post, new { id = "LoadAddOptionalDetailsForm", @style = "height:0px;margin-top: 130px;" }))
{
    <div id="AddOptionalDetailsDiv" style="display: none; height: 110px; float: left; ">
        <div id="ErrorMessagesDivPopUp">
            <label for="Validation" id="errorMessageClient" class="errorMessage"></label>
            @if (Model.Message != null)
            {
                @Html.LabelForModel(Model.Message, new { @class = "errorMessage", id = "errorMessageServer" })
            }
        </div>
        <div style="width: 541px; margin-left: 9px; float:left">
            <table class="table table-bordered table-hover table-condensed" style="width: 520px; table-layout: fixed; background-color: white;">
                <tbody>
                    <tr>
                        <td width="20%;">@Html.TextBoxFor(model => model.PaxFrom, new { @class = "AddOptionalDetailElementChange table_inputs_100 table_inputs_WithoutBox QuotaOnlyDigits Required", @PlaceHolder = "Pax From" })</td>
                        <td width="20%;">@Html.TextBoxFor(model => model.PaxTo, new { @class = "AddOptionalDetailElementChange table_inputs_100 table_inputs_WithoutBox QuotaOnlyDigits Required", @PlaceHolder = "Pax To" })</td>
                        <td width="20%;">
                            @Html.DropDownListFor(model => Model.SelectedCurrency, new SelectList(Model.Currency, "Value", "Text"), new { @class = "AddOptionalDetailElementChange table_inputs_100 table_inputs_WithoutBox AddCurrencyDrop" })
                        </td>
                        <td width="20%;">@Html.TextBoxFor(model => model.Price, new { @class = "AddOptionalDetailElementChange table_inputs_100 table_inputs_WithoutBox QuotaOnlyDecimalDigits", @PlaceHolder = "Price" })</td>
                        <td width="10%;" style="text-align:center">@Html.CheckBoxFor(model => model.BusIncluded, new { @class = "AddOptionalDetailElementChange" })</td>
                        <td width="10%;" style="text-align:center">@Html.CheckBoxFor(model => model.GuideIncluded, new { @class = "AddOptionalDetailElementChange" })</td>
                    </tr>
                </tbody>
            </table>
            <div style="float: right;margin-right:21px;">
                <button class="btn14 btn50" type="button" onclick="AddNewOptionalDetailsClose()">Cancel</button>
                @if (Model.MenuManageOptionalEdit)
                {
                    <button class="btn14 btn50" type="button" id="AddOptionalDetailBtn">Save</button>
                }
                else
                {
                    <button class="btn14 btn50 disabled" type="button" disabled="disabled" id="AddOptionalDetailBtn">Save</button>
                }
            </div>
        </div>
    </div>
}





